<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
  <head>
    <title>一栋楼房信息查询</title>
	<script type="text/javascript" language="javascript" src="<%=request.getContextPath()%>/js/common.js"></script>
	<script type="text/javascript" language="javascript" src="<%=request.getContextPath()%>/js/page.js"></script>
	<script type="text/javascript" language="javascript" src="<%=request.getContextPath()%>/js/calendar/WdatePicker.js"></script>
	<meta http-equiv="Content-Type" contect="text/html" charset="UTF-8"> 
  </head>
  <body>
  	<div align="center">
	    <form id="form" name="form" action="${pageContext.request.contextPath}/room/build!list.action" method="post">
	    	<table border="0" cellpadding="0" width="60%" align="center">
	    		<tr><td colspan="6" align="right"><a href="build_add.jsp" target="_target">新增</a></td></tr>
	    		<tr><!--   onClick="WdatePicker()"  -->
	    			<td width="20%">楼层:</td><td align="left"><input name="build.floor" type="text" id="build.floor" value="${build.floor}"/></td>
	    			<td width="20%">房间数量:</td><td align="left"><input name="build.roomSum" type="text" id="build.roomSum" value="${build.roomSum}"/></td>
	    			<td width="20%">栋描述:</td><td align="left"><input name="build.buildDesc" type="text" id="build.buildDesc" value="${build.buildDesc}"/></td>
	    		</tr>
	    		<tr>
	    			<td width="20%">楼水费:</td><td align="left"><input name="build.waterPrice" type="text" id="build.waterPrice" value="${build.waterPrice}"/></td>
	    			<td width="20%">电费:</td><td align="left"><input name="build.electricPrice" type="text" id="build.electricPrice" value="${build.electricPrice}"/></td>
	    			<td width="20%">垃圾费:</td><td align="left"><input name="build.garbagePrice" type="text" id="build.garbagePrice" value="${build.garbagePrice}"/></td>
	    		</tr>
	    		<tr><td colspan="6" align="center">
	    			<input type="hidden" name="room.curentPage" id="curentPage" value="${page.curentPage}">
	    			<input name="submit1" type="button"  onclick="queryForm();" value="查询"/>
	    		</td>
	    		</tr>
			</table>				
	    </form>
	    
	    
	    <table align="center" width="80%" border="0">
	    	<tr>
	    	  <td>
	    		<table align="center" width="100%" border="1">
		    		<tr>
			    		<td>栋ID</td><td>楼层</td><td>房间数量</td><td>栋描述</td>
			    		<td>楼水费</td><td>电费</td><td>垃圾费</td><td>范围年份</td>
			    		<td>修改</td><td>删除</td><td>详情</td>
			    	</tr>
			    	<s:iterator value="page.pageList" id="bean">
			    	<tr>
			    		<td>${bean.buildId}</td><td>${bean.floor}</td><td>${bean.roomSum}</td><td>${bean.buildDesc}</td>
			    		<td>${bean.waterPrice}</td><td>${bean.electricPrice}</td><td>${bean.buildDesc}</td><td>${bean.buildYear}</td>
			    		<td><a href="#" onclick="rendToUpdate('${bean.buildId}');">${bean.buildId}</a></td>
			    		<td><a href="#" onclick="rendToDelete('${bean.buildId}');">${bean.buildId}</a></td>
			    		<td><a href="#" onclick="rendToDetail('${bean.buildId}');">${bean.buildId}</a></td>
			    	</tr>
			    	</s:iterator>
	    		</table>
	    	  </td>
	    	</tr>
	    	<tr>
	    		<td><%@ include file="/common/page.jsp"%></td>
	    	</tr>
	    </table>
	   
    </div>
  </body>
  
  <script type="text/javascript">
  	function rendToDelete(buildId){
  		if (confirm("确认要删除此条数据吗？")) {
  			window.location="<%=request.getContextPath() %>/room/build!delete.action?build.buildId="+buildId;
        }
        return ;
  	}

  	function rendToUpdate(buildId){
  		 window.open("<%=request.getContextPath() %>/room/build!query.action?buildId=" + buildId, "_blank", 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=300,height=260,left=300,top=300');
  	}

  	function rendToDetail(buildId){
  		 window.open("<%=request.getContextPath() %>/room/build!detail.action?buildId=" + buildId, "_blank", 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=300,height=260,left=300,top=300');
 	}

	function queryForm(){
		var form=document.getElementById("form");
		document.getElementById("curentPage").value=0;
 	 	form.submit();
	}
  </script>
</html>
